package com.example.zhihuhelpapp.utils;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;

public class DialogUtils {
    public static void showDialog(Context context, String title, String content,
                                  DialogInterface.OnClickListener onClickListener) {
        new AlertDialog.Builder(context)
                .setTitle(title)
                .setMessage(content)
                .setNegativeButton("确定", onClickListener)
                .setNeutralButton("取消", (dialog, which) -> dialog.dismiss())
                .show();
    }

    public static void showItemListDialog(Context context, String[] itemList,
                                          DialogInterface.OnClickListener onClickListener) {
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setTitle("提示");
        builder.setItems(itemList, onClickListener);
        builder.show();
    }
}
